//
//  InviteRecoedTableViewController.m
//  bitcoin
//
//  Created by caiyajun on 2018/6/12.
//  Copyright © 2018年 比特币. All rights reserved.
//

#import "InviteRecoedTableViewController.h"
#import "InviteRecordCell.h"
#import "MJRefresh.h"
@interface InviteRecoedTableViewController ()

@end

@implementation InviteRecoedTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 3;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 73;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    InviteRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:@"InviteRecordCell" forIndexPath:indexPath];
    if (cell == nil) {
        cell = [[InviteRecordCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"InviteRecordCell"];
    }
    
    return cell;
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context

{
    
    if ([keyPath isEqualToString:@"contentOffset"])
        
    {
        
                CGPoint offset = [change[NSKeyValueChangeNewKey] CGPointValue];
                if (offset.y==-1) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"ProductComment" object:nil];
                    return;
                }
        
    }
    
}
@end

